package com.qingfeng.core.dao.qingfeng;

import com.qingfeng.core.config.database.BaseMapper;
import com.qingfeng.core.dao.BaseDao;
import com.qingfeng.core.entity.qingfeng.Declaration;
import com.qingfeng.core.mapper.qingfeng.DeclarationMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

/**
 * @description:申明公告
 * @author:LWY
 * @date: 2017/11/17 14:44
 * @modified:
 */
@Repository
public class DeclarationDao extends BaseDao<Declaration> {
    @Autowired
    DeclarationMapper declarationMapper;


    @Override
    protected BaseMapper<Declaration> getBaseMapper() {
        return declarationMapper;
    }

    /**
     * 根据代码获取申明
     *
     * @param d_code 申明代码
     */
    public Declaration get(String d_code) {
        Declaration declaration = new Declaration();
        declaration.setD_code(d_code.toUpperCase());
        return declarationMapper.selectOne(declaration);
    }
}
